<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   
<script type="text/javascript">

function cm_savesyncconfig(type)
{
    var id = document.getElementById("id").value;
    var channelid = document.getElementById("channelid").value;
    var daylimit = document.getElementById("daylimit").value;
    var dayratio = document.getElementById("dayratio").value;
    var totallimit = document.getElementById("totallimit").value;
    var paydaylimit = document.getElementById("paydaylimit").value;
    var paymonthlimit = document.getElementById("paymonthlimit").value;

    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "mg/sync/save.do";
    var content = "type=" + type
                + "&syncconfig.id=" + id
                + "&syncconfig.channelid=" + channelid
                + "&syncconfig.daylimit=" + daylimit
                + "&syncconfig.dayratio=" + dayratio 
                + "&syncconfig.totallimit=" + totallimit
                + "&syncconfig.paydaylimit=" + paydaylimit
                + "&syncconfig.paymonthlimit=" + paymonthlimit;
    /*alert(content);*/
    var objectid = "cm_syncconfig";
    sendXMLHttpRequest(url, content, objectid); 
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">配置信息</strong></td>
    </tr> 
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>日限：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="id" type="hidden" value="<s:property value="syncconfig.id" />" >
        <input id="daylimit" type="text" size="60" 
          value="<s:property value="syncconfig.daylimit" />" /><font color="red">-1表示不限制</font></td>
    </tr>
   <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>日百分比：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="dayratio" type="text" size="60" 
          value="<s:property value="syncconfig.dayratio" />" /><font color="red">-1表示不限制</font></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>总限：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="totallimit" type="text" size="60" 
          value="<s:property value="syncconfig.totallimit" />" /><font color="red">-1表示不限制</font></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>计费日限：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="paydaylimit" type="text" size="60" 
          value="<s:property value="syncconfig.paydaylimit" />" /><font color="red">单位：分</font></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>计费月限：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="paymonthlimit" type="text" size="60" 
          value="<s:property value="syncconfig.paymonthlimit" />" /><font color="red">单位：分</font></td>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')" >
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="cm_savesyncconfig('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="cm_savesyncconfig('update');">修改</button>
        &nbsp;&nbsp;        
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="cm_savesyncconfig('delete');">删除</button>
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>